Overview
Fetches the complete daily securities list including price band information for all listed securities from NSE Archives. Unlikefetch_incremental_price_bands.py which shows only changes, this provides the full universe of securities with their current circuit limits.
Source: fetch_complete_price_bands.pyPhase: Phase 2 (Enrichment)
Output:
complete_price_bands.json
Data Source
NSE Archives CSV Endpoint
Date in
ddmmyyyy format (e.g., 03032024 for March 3, 2024)Example URL
CSV Format
The NSE CSV contains comprehensive security information (example structure):Function Signature
Date Search Logic
Identical to incremental script - searches backwards from today up to 7 days:CSV Parsing
Uses pandas for robust CSV parsing:Output Structure
Stock trading symbol
Full company name
Series type (EQ, BE, etc.)
Original listing date
Paid-up share value
Minimum trading lot size
International Securities Identification Number
Face value per share
Current circuit limit percentage (e.g., “20”, “10”, “5”, “2”)
Example Output
Dependencies
requests— HTTP client for downloading CSVjson— JSON serializationdatetime— Date calculationspandas— CSV parsing and data manipulationio— In-memory file handling for CSV parsing
HTTP Headers
Configuration Differences
Compared tofetch_incremental_price_bands.py:
- Timeout: 15 seconds (vs 10) due to larger file size
- URL Pattern:
sec_list_{date}.csv(vseq_band_changes_{date}.csv) - Output File:
complete_price_bands.json(vsincremental_price_bands.json)
Error Handling
- 15-second timeout per HTTP request (larger file)
- Gracefully handles 404 (file not found) for non-trading days
- Continues searching backwards through date range
- Reports parse errors but continues to next date
Usage Example
Integration
This script is part of Phase 2 (Enrichment) in the EDL Pipeline. The output file is consumed by:bulk_market_analyzer.py— Populates the “Circuit Limit” field for all stocks- Used as the master source of truth for current circuit limits
Data Volume
- Typical record count: ~2,800-2,900 securities
- File size: 2-3 MB (JSON)
- Download time: 2-5 seconds
Use Cases
vs. Incremental Price Bands
| Script | Purpose | Record Count | Use Case |
|---|---|---|---|
fetch_incremental_price_bands.py | Daily changes only | 5-50 | Event markers for circuit revisions |
fetch_complete_price_bands.py | Full universe snapshot | ~2,850 | Master lookup for current limits |
Price Band Interpretation
Circuit Limit Bands:
2%— Extreme surveillance (very high risk)5%— High surveillance10%— Moderate surveillance20%— Normal (standard circuit limit for most stocks)
Data Availability Notes
- NSE typically publishes this file on trading days only
- File is usually available after market close (3:30 PM IST)
- Weekends and holidays will have no file (404 response)
- The 7-day search window ensures data freshness even after long weekends
- Unlike incremental changes, this file is published daily and contains the complete list